(function(){
	angular.module('app')
		.factory('LoginFactory',fn);
	function fn(urlCnst,userService){
	    var self = {};
	    self.login = function (body,cb) {
	    	function cb2(err,res) {
	    		if(!err){
	    			//userService.username = res['res']['username'];
	    			//userService.isConsultant = res['res']['isConsultant'];
	    			//if (res['res']['isConsultant']){
	    			//	userService.consultantId = res['res']['username'];
					//}
                    //if (res['res']['username']=='admin'){
                    //    userService.isAdmin = true;
                    //}
                }
	    		//console.log(res);
	    		//console.log(userService.isConsultant);
				cb(err,res);
            }
	        urlCnst.post('login',body,cb2);
        };
		return self;
	}
})();
